The present invention relates to a method and apparatus for resolution conversion for multi-dimensional image data and in particular digital image data. The invention also relates to a computer program product including a computer readable medium having recorded thereon a computer program for resolution conversion of multi-dimensional image data and in particular digital image data.
Prior art continuous kernels for digital data resolution conversion include the nearest neighbour (NN), linear quadratic and cubic kernels. The NN kernel is the simplest method of interpolation, simply interpolating the image with the pixel value that is spatially nearest to the required one. This method works quite well when the scaling ratio is an integral multiple of the original data as it introduces no new values, ie., no new colours, and preserves sharp edges. However, at other ratios it has the disadvantage of shifting edge locations which often produces visible distortions in the output image, especially in images containing text or fine line details.
Linear interpolation on the other hand allows for the introduction of new grey levels (or colours) that are effectively used to position edges at sub-pixel locations. This has the advantage of reducing the effect of shifted edge locations, however sharp edges can now appear to be blurred. Quadratic and cubic interpolation provide steeper step responses and therefore less edge blurring, however, the steeper response results in an overshoot on either side of the edge. These overshoots can make the edges in natural images appear sharper, but on text, fine lines, or on other computer generated graphics these overshoots are clearly visible and detract from the perceived image quality and text legibility.
In the prior art systems kernels such as the nearest neighbour (NN), linear, quadratic, and cubic kernels are often used by either applying them first to the rows of the image and then to the columns, known as a separable implementation, or a 2-dimensional kernel is formed and convolved directly with the image data. These are then termed bilinear and bicubic implementations. The disadvantage of the conventional interpolation kernels is that they interpolate mainly using pixel values from the horizontal and vertical directions relative to the interpolated pixel. Therefore, when interpolating an oblique edge, pixel values on either side of the edge are primarily used in the interpolation rather than pixels along the edge. This results in an interpolated edge that no longer appears to be smooth, but appears to be jagged. These artefacts are commonly referred to as jaggies and are illustrated for NN, bilinear, and bicubic interpolation kernels in FIG. 1 for an eight times expansion factor of an original oblique edge. It can be seen that the jaggies are most pronounced for the NN interpolator and become progressively less objectionable for the bilinear and the bicubic interpolators respectively. However, even for the bicubic interpolator the jaggies are still noticeable and it can be seen that the reduction in the jaggy effect is achieved at the expense of increased edge blur (an effect that is particularly noticeable on the bilinear interpolator).
It is an object of the present invention to ameliorate one or more disadvantages of the prior art.
According to one aspect of the present invention there is provided a method of providing a representation of image data, the method comprising the following steps:
(i) accessing a plurality of discrete sample values of said image data;
(ii) determining an angle of orientation of said sample values;
(iii) calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
(iv) convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to another aspect of the present invention there is provided an apparatus for providing a representation of image data, the apparatus comprising:
accessing means for accessing a plurality of discrete sample values of said image data;
angle orientation determining means for determining an angle of orientation of said sample values;
calculating means for calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
convolving means for convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to still another aspect of the present invention there is provided a computer readable medium for storing a program for an apparatus which processes data, said processing comprising a method of providing a representation of image data, said program comprising:
code for accessing a plurality of discrete sample values of said image data;
code for determining an angle of orientation of said sample values;
code for calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
code for convolving said kernel values with said discrete sample values to provide a representation of said image data.
According to still another aspect of the present invention there is provided a method of providing a representation of image data, the method comprising the following steps:
(i) accessing a plurality of discrete sample values of said image data;
(ii) determining an angle of orientation of each said sample values;
(iii) calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
(iv) convolving said kernel values with said discrete sample values to provide a representation of said image data, wherein said first kernels are of the form:                     h        ⁡                  (                                    s              x                        ,                          s              y                                )                            θ        =        0              =                            1                      2                          ⁢                  {                                                    h                ⁡                                  (                                      s                    x                                    )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                      s                    y                                    )                                                            c                =                0                                              }                ⁢                  
                ⁢                              h            ⁡                          (                                                s                  x                                ,                                  s                  y                                            )                                            θ            =                          π              /              2                                          =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                      s                    x                                    )                                                            c                =                0                                      ·                                          h                ⁡                                  (                                      s                    y                                    )                                                            c                =                0.5                                              "AutoRightMatch"                                h      ⁢                        (                                    s              x                        ,                          s              y                                )                          θ          =                      π            /            4                                =                            1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    s                        x                                            +                                              s                        y                                                              2                                    )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                                                                    s                        x                                            -                                              s                        y                                                                                    2                                                        )                                                            c                =                0                                              }                ⁢                  
                ⁢                              h            ⁡                          (                                                s                  x                                ,                                  s                  y                                            )                                            θ            =                          3              ⁢                              xe2x80x83                            ⁢                              π                /                4                                                        =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    s                        x                                            +                                              s                        y                                                                                    2                                                        )                                                            c                =                0                                      ·                                          h                ⁡                                  (                                                                                    s                        x                                            -                                              s                        y                                                              2                                    )                                                            c                =                0.5                                              }                    
and wherein s=t/xcex94t and xcex8 is the angle of orientation of the sample.
According to still another aspect of the present invention there is provided an apparatus for providing a representation of image data, said apparatus comprising:
accessing means for accessing a plurality of discrete sample values of said image data;
angle of orientation determining means for determining an angle of orientation of each said sample values;
calculating means for calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
convolving means for convolving said kernel values with said discrete sample values to provide a representation of said image data, wherein said first kernels are of the form:                     h        ⁡                  (                                    s              x                        ,                          s              y                                )                            θ        =        0              =                            1                      2                          ⁢                  {                                                    h                ⁡                                  (                                      s                    x                                    )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                      s                    y                                    )                                                            c                =                0                                              }                ⁢                  
                ⁢                              h            ⁡                          (                                                s                  x                                ,                                  s                  y                                            )                                            θ            =                          π              /              2                                          =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                      s                    x                                    )                                                            c                =                0                                      ·                                          h                ⁡                                  (                                      s                    y                                    )                                                            c                =                0.5                                              "AutoRightMatch"                                h      ⁢                        (                                    s              x                        ,                          s              y                                )                          θ          =                      π            /            4                                =                            1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    s                        x                                            +                                              s                        y                                                              2                                    )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                                                                    s                        x                                            -                                              s                        y                                                                                    2                                                        )                                                            c                =                0                                              }                ⁢                  
                ⁢                              h            ⁡                          (                                                s                  x                                ,                                  s                  y                                            )                                            θ            =                          3              ⁢                              xe2x80x83                            ⁢                              π                /                4                                                        =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    s                        x                                            +                                              s                        y                                                                                    2                                                        )                                                            c                =                0                                      ·                                          h                ⁡                                  (                                                                                    s                        x                                            -                                              s                        y                                                              2                                    )                                                            c                =                0.5                                              }                    
and wherein s=t/xcex94t and xcex8 is the angle of orientation of the sample.
According to still another aspect of the present invention there is provided a computer readable medium for storing a program for an apparatus which processes data, said processing comprising a method of providing a representation of image data, said program comprising:
code for accessing a plurality of discrete sample values of said image data;
code for determining an angle of orientation of each said sample values;
code for calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
code for convolving said kernel values with said discrete sample values to provide a representation of said image data, wherein said first kernels are of the form:                     h        ⁡                  (                                    s              x                        ,                          s              y                                )                            θ        =        0              =                            1                      2                          ⁢                  {                                                    h                ⁡                                  (                                      s                    x                                    )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                      s                    y                                    )                                                            c                =                0                                              }                ⁢                  
                ⁢                              h            ⁡                          (                                                s                  x                                ,                                  s                  y                                            )                                            θ            =                          π              /              2                                          =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                      s                    x                                    )                                                            c                =                0                                      ·                                          h                ⁡                                  (                                      s                    y                                    )                                                            c                =                0.5                                              "AutoRightMatch"                                h      ⁢                        (                                    s              x                        ,                          s              y                                )                          θ          =                      π            /            4                                =                            1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    s                        x                                            +                                              s                        y                                                              2                                    )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                                                                    s                        x                                            -                                              s                        y                                                                                    2                                                        )                                                            c                =                0                                              }                ⁢                  
                ⁢                              h            ⁡                          (                                                s                  x                                ,                                  s                  y                                            )                                            θ            =                          3              ⁢                              xe2x80x83                            ⁢                              π                /                4                                                        =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    s                        x                                            +                                              s                        y                                                                                    2                                                        )                                                            c                =                0                                      ·                                          h                ⁡                                  (                                                                                    s                        x                                            -                                              s                        y                                                              2                                    )                                                            c                =                0.5                                              }                    
and wherein s=t/xcex94t and xcex8 is the angle of orientation of the sample.
According to still another aspect of the present invention there is provided a method of providing a representation of image data, the method comprising the following steps:
(i) accessing a plurality of discrete sample values of said image data;
(ii) determining an angle of orientation of each said sample values;
(iii) calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
(iv) convolving said kernel values with said discrete sample values to provide a representation of said image data, wherein said first kernels are of the form:             h      ⁢                        (                                    s              x                        ,                          s              y                                )                          0          ≤          θ          ≤                      π            /            2                                =                  1                  2                    ⁢              xe2x80x83            ⁢                                    {                                                            h                  ⁡                                      (                                          1                      -                                              2                        ⁢                                                  xe2x80x83                                                ⁢                                                  θ                          /                          π                                                                                      )                                                  ⁢                                  s                  x                                            +                                                (                                      2                    ⁢                                          xe2x80x83                                        ⁢                                          θ                      /                      π                                                        )                                ⁢                                  s                  y                                                      )                                c            =            0.5                          ·                  "AutoLeftMatch"                                    h              ⁡                              (                                                      (                                                                                            (                                                      2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                )                                                ⁢                                                  s                          x                                                                    +                                                                        (                                                                                    2                              ⁢                                                              xe2x80x83                                                            ⁢                                                              θ                                /                                π                                                                                      -                            1                                                    )                                                ⁢                                                  s                          y                                                                                      )                                    ⁢                  w                  ⁢                                      xe2x80x83                                    ⁢                                      (                    θ                    )                                                  )                                                    c              =              0                                }                                                  h          ⁡                      (                                          s                x                            ,                              s                y                                      )                                                π            /            2                     less than           θ           less than           π                    =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    (                                                                              2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                -                          1                                                )                                            ⁢                                              s                        x                                                              +                                                                  (                                                                              2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                -                          2                                                )                                            ⁢                                              s                        y                                                                              )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                                            (                                                                                                    (                                                                                          2                                ⁢                                                                  xe2x80x83                                                                ⁢                                                                  θ                                  /                                  π                                                                                            -                              2                                                        )                                                    ⁢                                                      s                            x                                                                          +                                                                              (                                                          1                              -                                                              2                                ⁢                                                                  xe2x80x83                                                                ⁢                                                                  θ                                  /                                  π                                                                                                                      )                                                    ⁢                                                      s                            y                                                                                              )                                        ⁢                    w                    ⁢                                          xe2x80x83                                        ⁢                                          (                      θ                      )                                                        )                                                            c                =                0                                              }                      ,  
and wherein s=t/xcex94t and xcex8 is the angle of orientation of the sample.
According to still another aspect of the present invention there is provided an apparatus for providing a representation of image data, said apparatus comprising:
accessing means for accessing a plurality of discrete sample values of said image data;
angle of orientation determining means for determining an angle of orientation of each said sample values;
calculating means for calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
convolving means for convolving said kernel values with said discrete sample values to provide a representation of said image data, wherein said first kernels are of the form:             h      ⁢                        (                                    s              x                        ,                          s              y                                )                          0          ≤          θ          ≤                      π            /            2                                =                  1                  2                    ⁢              xe2x80x83            ⁢                                    {                                                            h                  ⁡                                      (                                          1                      -                                              2                        ⁢                                                  xe2x80x83                                                ⁢                                                  θ                          /                          π                                                                                      )                                                  ⁢                                  s                  x                                            +                                                (                                      2                    ⁢                                          xe2x80x83                                        ⁢                                          θ                      /                      π                                                        )                                ⁢                                  s                  y                                                      )                                c            =            0.5                          ·                  "AutoLeftMatch"                                    h              ⁡                              (                                                      (                                                                                            (                                                      2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                )                                                ⁢                                                  s                          x                                                                    +                                                                        (                                                                                    2                              ⁢                                                              xe2x80x83                                                            ⁢                                                              θ                                /                                π                                                                                      -                            1                                                    )                                                ⁢                                                  s                          y                                                                                      )                                    ⁢                  w                  ⁢                                      xe2x80x83                                    ⁢                                      (                    θ                    )                                                  )                                                    c              =              0                                }                                                  h          ⁡                      (                                          s                x                            ,                              s                y                                      )                                                π            /            2                     less than           θ           less than           π                    =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    (                                                                              2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                -                          1                                                )                                            ⁢                                              s                        x                                                              +                                                                  (                                                                              2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                -                          2                                                )                                            ⁢                                              s                        y                                                                              )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                                            (                                                                                                    (                                                                                          2                                ⁢                                                                  xe2x80x83                                                                ⁢                                                                  θ                                  /                                  π                                                                                            -                              2                                                        )                                                    ⁢                                                      s                            x                                                                          +                                                                              (                                                          1                              -                                                              2                                ⁢                                                                  xe2x80x83                                                                ⁢                                                                  θ                                  /                                  π                                                                                                                      )                                                    ⁢                                                      s                            y                                                                                              )                                        ⁢                    w                    ⁢                                          xe2x80x83                                        ⁢                                          (                      θ                      )                                                        )                                                            c                =                0                                              }                      ,  
and wherein s=t/xcex94t and xcex8 is the angle of orientation of the sample.
According to still another aspect of the present invention there is provided a computer readable medium for storing a program for an apparatus which processes data, said processing comprising a method of providing a representation of image data, said program comprising:
code for accessing a plurality of discrete sample values of said image data;
code for determining an angle of orientation of each said sample values;
code for calculating kernel values for each of said discrete sample values using one of a plurality of first kernels depending upon the angle of orientation of said discrete sample value, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
code for convolving said kernel values with said discrete sample values to provide a representation of said image data, wherein said first kernels arc of the form:             h      ⁢                        (                                    s              x                        ,                          s              y                                )                          0          ≤          θ          ≤                      π            /            2                                =                  1                  2                    ⁢              xe2x80x83            ⁢                                    {                                                            h                  ⁡                                      (                                          1                      -                                              2                        ⁢                                                  xe2x80x83                                                ⁢                                                  θ                          /                          π                                                                                      )                                                  ⁢                                  s                  x                                            +                                                (                                      2                    ⁢                                          xe2x80x83                                        ⁢                                          θ                      /                      π                                                        )                                ⁢                                  s                  y                                                      )                                c            =            0.5                          ·                  "AutoLeftMatch"                                    h              ⁡                              (                                                      (                                                                                            (                                                      2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                )                                                ⁢                                                  s                          x                                                                    +                                                                        (                                                                                    2                              ⁢                                                              xe2x80x83                                                            ⁢                                                              θ                                /                                π                                                                                      -                            1                                                    )                                                ⁢                                                  s                          y                                                                                      )                                    ⁢                  w                  ⁢                                      xe2x80x83                                    ⁢                                      (                    θ                    )                                                  )                                                    c              =              0                                }                                                  h          ⁡                      (                                          s                x                            ,                              s                y                                      )                                                π            /            2                     less than           θ           less than           π                    =                        1                      2                          ⁢                  {                                                    h                ⁡                                  (                                                                                    (                                                                              2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                -                          1                                                )                                            ⁢                                              s                        x                                                              +                                                                  (                                                                              2                            ⁢                                                          xe2x80x83                                                        ⁢                                                          θ                              /                              π                                                                                -                          2                                                )                                            ⁢                                              s                        y                                                                              )                                                            c                =                0.5                                      ·                                          h                ⁡                                  (                                                            (                                                                                                    (                                                                                          2                                ⁢                                                                  xe2x80x83                                                                ⁢                                                                  θ                                  /                                  π                                                                                            -                              2                                                        )                                                    ⁢                                                      s                            x                                                                          +                                                                              (                                                          1                              -                                                              2                                ⁢                                                                  xe2x80x83                                                                ⁢                                                                  θ                                  /                                  π                                                                                                                      )                                                    ⁢                                                      s                            y                                                                                              )                                        ⁢                    w                    ⁢                                          xe2x80x83                                        ⁢                                          (                      θ                      )                                                        )                                                            c                =                0                                              }                      ,  
and wherein s=t/xcex94t and xcex8 is the angle of orientation of the sample.
According to still another aspect of the present invention there is provided a method of converting a first set of discrete data sample values of an image having a first sample rate to a second set of discrete data sample values of said image having a second sample rate, the method comprising the following steps:
(i) accessing said first set of data sample values; and
(ii) performing the following operations for each data value of said second set;
(a) determining an angle of orientation for each of said discrete sample values of said first set;
(b) calculating kernel values for each of said discrete sample values of said first set, according to one of a plurality of first kernels depending upon the angle of orientation of each of said discrete sample values, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
(c) convolving said kernel values with said discrete sample values of said first data set to provide a current data value of said second set.
According to still another aspect of the present invention there is provided an apparatus for converting a first set of discrete data sample values of an image having a first sample rate to a second set of discrete data sample values of said image having a second sample rate, the method comprising the following steps:
accessing means for accessing said first set of data sample values; and
processing means for performing the following operations for each data value of said second set;
(a) determining an angle of orientation for each of said discrete sample values of said first set;
(b) calculating kernel values for each of said discrete sample values of said first set, according to one of a plurality of first kernels depending upon the angle of orientation of each of said discrete sample values, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
(c) convolving said kernel values with said discrete sample values of said first data set to provide a current data value of said second set.
According to still another aspect of the present invention there is provided a computer readable medium for storing a program for an apparatus which processes data, said processing comprising a method of converting a first set of discrete data sample values of an image having a first sample rate to a second set of discrete data sample values of said image having a second sample rate, said program comprising:
code for accessing said first set of data sample values; and
code for performing the following operations for each data value of said second set;
(a) determining an angle of orientation for each of said discrete sample values of said first set;
(b) calculating kernel values for each of said discrete sample values of said first set, according to one of a plurality of first kernels depending upon the angle of orientation of each of said discrete sample values, wherein said first kernels are constructed by rotating a second kernel from a first angle of orientation to a second angle of orientation; and
(c) convolving said kernel values with said discrete sample values of said first data set to provide a current data value of said second set.
According to still another aspect of the present invention there is provided a method of generating a steerable kernel for image processing, the method comprising the following steps:
(i) accessing a kernel for image processing;
(ii) rotating said kernel from a first angle of orientation to a second angle of orientation to form a steerable kernel; and
(iii) storing said rotated kernel.